package me.qi.kancha.security.grant.custom;

import org.springframework.security.core.Authentication;
import org.springframework.security.oauth2.common.exceptions.InvalidGrantException;
import org.springframework.security.oauth2.provider.OAuth2Request;

/**
 * 自定义认证服务
 *
 * @author sun
 * @date 2021/12/24 15:15
 * @modified By：
 */
public interface CustomAuthService {
    /**
     * 自定义认证类型
     *
     * @return
     */
    String getGrantType();

    /**
     * 获得用户认证信息
     *
     * @param oAuth2Request
     * @return
     */
    Authentication authorization(OAuth2Request oAuth2Request) throws InvalidGrantException;
}
